DROP TABLE CRST_RA_CUSTOMER_TRX_LINES_ALL;

CREATE TABLE CRST_RA_CUSTOMER_TRX_LINES_ALL
(
  CUSTOMER_TRX_LINE_ID            NUMBER(15)    NOT NULL,
  LAST_UPDATE_DATE                DATE          NOT NULL,
  LAST_UPDATED_BY                 NUMBER(15)    NOT NULL,
  CREATION_DATE                   DATE          NOT NULL,
  CREATED_BY                      NUMBER(15)    NOT NULL,
  LAST_UPDATE_LOGIN               NUMBER(15),
  CUSTOMER_TRX_ID                 NUMBER(15)    NOT NULL,
  LINE_NUMBER                     NUMBER        NOT NULL,
  SET_OF_BOOKS_ID                 NUMBER(15)    NOT NULL,
  REASON_CODE                     VARCHAR2(30 BYTE),
  INVENTORY_ITEM_ID               NUMBER(15),
  DESCRIPTION                     VARCHAR2(240 BYTE),
  PREVIOUS_CUSTOMER_TRX_ID        NUMBER(15),
  PREVIOUS_CUSTOMER_TRX_LINE_ID   NUMBER(15),
  QUANTITY_ORDERED                NUMBER,
  QUANTITY_CREDITED               NUMBER,
  QUANTITY_INVOICED               NUMBER,
  UNIT_STANDARD_PRICE             NUMBER,
  UNIT_SELLING_PRICE              NUMBER,
  SALES_ORDER                     VARCHAR2(50 BYTE),
  SALES_ORDER_REVISION            NUMBER,
  SALES_ORDER_LINE                VARCHAR2(30 BYTE),
  SALES_ORDER_DATE                DATE,
  ACCOUNTING_RULE_ID              NUMBER(15),
  ACCOUNTING_RULE_DURATION        NUMBER(15),
  LINE_TYPE                       VARCHAR2(20 BYTE) NOT NULL,
  ATTRIBUTE_CATEGORY              VARCHAR2(30 BYTE),
  ATTRIBUTE1                      VARCHAR2(150 BYTE),
  ATTRIBUTE2                      VARCHAR2(150 BYTE),
  ATTRIBUTE3                      VARCHAR2(150 BYTE),
  ATTRIBUTE4                      VARCHAR2(150 BYTE),
  ATTRIBUTE5                      VARCHAR2(150 BYTE),
  ATTRIBUTE6                      VARCHAR2(150 BYTE),
  ATTRIBUTE7                      VARCHAR2(150 BYTE),
  ATTRIBUTE8                      VARCHAR2(150 BYTE),
  ATTRIBUTE9                      VARCHAR2(150 BYTE),
  ATTRIBUTE10                     VARCHAR2(150 BYTE),
  REQUEST_ID                      NUMBER(15),
  PROGRAM_APPLICATION_ID          NUMBER(15),
  PROGRAM_ID                      NUMBER(15),
  PROGRAM_UPDATE_DATE             DATE,
  RULE_START_DATE                 DATE,
  INITIAL_CUSTOMER_TRX_LINE_ID    NUMBER(15),
  INTERFACE_LINE_CONTEXT          VARCHAR2(30 BYTE),
  INTERFACE_LINE_ATTRIBUTE1       VARCHAR2(30 BYTE),
  INTERFACE_LINE_ATTRIBUTE2       VARCHAR2(30 BYTE),
  INTERFACE_LINE_ATTRIBUTE3       VARCHAR2(30 BYTE),
  INTERFACE_LINE_ATTRIBUTE4       VARCHAR2(30 BYTE),
  INTERFACE_LINE_ATTRIBUTE5       VARCHAR2(30 BYTE),
  INTERFACE_LINE_ATTRIBUTE6       VARCHAR2(30 BYTE),
  INTERFACE_LINE_ATTRIBUTE7       VARCHAR2(30 BYTE),
  INTERFACE_LINE_ATTRIBUTE8       VARCHAR2(30 BYTE),
  SALES_ORDER_SOURCE              VARCHAR2(50 BYTE),
  TAXABLE_FLAG                    VARCHAR2(1 BYTE),
  EXTENDED_AMOUNT                 NUMBER        NOT NULL,
  REVENUE_AMOUNT                  NUMBER,
  AUTORULE_COMPLETE_FLAG          VARCHAR2(1 BYTE),
  LINK_TO_CUST_TRX_LINE_ID        NUMBER(15),
  ATTRIBUTE11                     VARCHAR2(150 BYTE),
  ATTRIBUTE12                     VARCHAR2(150 BYTE),
  ATTRIBUTE13                     VARCHAR2(150 BYTE),
  ATTRIBUTE14                     VARCHAR2(150 BYTE),
  ATTRIBUTE15                     VARCHAR2(150 BYTE),
  TAX_PRECEDENCE                  NUMBER,
  TAX_RATE                        NUMBER,
  ITEM_EXCEPTION_RATE_ID          NUMBER(15),
  TAX_EXEMPTION_ID                NUMBER(15),
  MEMO_LINE_ID                    NUMBER(15),
  AUTORULE_DURATION_PROCESSED     NUMBER(15),
  UOM_CODE                        VARCHAR2(3 BYTE),
  DEFAULT_USSGL_TRANSACTION_CODE  VARCHAR2(30 BYTE),
  DEFAULT_USSGL_TRX_CODE_CONTEXT  VARCHAR2(30 BYTE),
  INTERFACE_LINE_ATTRIBUTE10      VARCHAR2(30 BYTE),
  INTERFACE_LINE_ATTRIBUTE11      VARCHAR2(30 BYTE),
  INTERFACE_LINE_ATTRIBUTE12      VARCHAR2(30 BYTE),
  INTERFACE_LINE_ATTRIBUTE13      VARCHAR2(30 BYTE),
  INTERFACE_LINE_ATTRIBUTE14      VARCHAR2(30 BYTE),
  INTERFACE_LINE_ATTRIBUTE15      VARCHAR2(30 BYTE),
  INTERFACE_LINE_ATTRIBUTE9       VARCHAR2(30 BYTE),
  VAT_TAX_ID                      NUMBER(15),
  AUTOTAX                         VARCHAR2(1 BYTE),
  LAST_PERIOD_TO_CREDIT           NUMBER,
  ITEM_CONTEXT                    VARCHAR2(30 BYTE),
  TAX_EXEMPT_FLAG                 VARCHAR2(1 BYTE),
  TAX_EXEMPT_NUMBER               VARCHAR2(80 BYTE),
  TAX_EXEMPT_REASON_CODE          VARCHAR2(30 BYTE),
  TAX_VENDOR_RETURN_CODE          VARCHAR2(30 BYTE),
  SALES_TAX_ID                    NUMBER(15),
  LOCATION_SEGMENT_ID             NUMBER(15),
  MOVEMENT_ID                     NUMBER(15),
  ORG_ID                          NUMBER(15),
  WH_UPDATE_DATE                  DATE,
  GLOBAL_ATTRIBUTE1               VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE2               VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE3               VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE4               VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE5               VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE6               VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE7               VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE8               VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE9               VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE10              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE11              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE12              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE13              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE14              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE15              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE16              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE17              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE18              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE19              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE20              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE_CATEGORY       VARCHAR2(30 BYTE),
  GROSS_UNIT_SELLING_PRICE        NUMBER,
  GROSS_EXTENDED_AMOUNT           NUMBER,
  AMOUNT_INCLUDES_TAX_FLAG        VARCHAR2(1 BYTE),
  TAXABLE_AMOUNT                  NUMBER,
  WAREHOUSE_ID                    NUMBER(15),
  TRANSLATED_DESCRIPTION          VARCHAR2(1000 BYTE),
  EXTENDED_ACCTD_AMOUNT           NUMBER,
  BR_REF_CUSTOMER_TRX_ID          NUMBER(15),
  BR_REF_PAYMENT_SCHEDULE_ID      NUMBER(15),
  BR_ADJUSTMENT_ID                NUMBER(15),
  MRC_EXTENDED_ACCTD_AMOUNT       VARCHAR2(2000 BYTE),
  PAYMENT_SET_ID                  NUMBER(15),
  CONTRACT_LINE_ID                NUMBER,
  SOURCE_DATA_KEY1                VARCHAR2(150 BYTE),
  SOURCE_DATA_KEY2                VARCHAR2(150 BYTE),
  SOURCE_DATA_KEY3                VARCHAR2(150 BYTE),
  SOURCE_DATA_KEY4                VARCHAR2(150 BYTE),
  SOURCE_DATA_KEY5                VARCHAR2(150 BYTE),
  INVOICED_LINE_ACCTG_LEVEL       VARCHAR2(15 BYTE),
  CUSTOMER_TRX_LINE_ID_N          NUMBER(15) 
);
